home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SBC Yahoo! Dial - Start Y… NeW Internet Experience
/
SBC Yahoo! Dial - Start.iso
/
pc
/
Reg
/
help
/
helpcommon.js
< prev
next >
Wrap
Text File
|
2002-04-18
|
7KB
|
285 lines
var storedfocus = "";
var btnClicked = false;
if (document.images) {
BtnCloseon = new Image(); BtnCloseon.src = "../images/sbc/buttons/close_over.gif";
BtnCloseoff = new Image(); BtnCloseoff.src = "../images/sbc/buttons/close_out.gif";
BtnClosedown = new Image(); BtnClosedown.src = "../images/sbc/buttons/close_down.gif";
BtnNoon = new Image(); BtnNoon.src = "../images/sbc/buttons/no_over.gif";
BtnNooff = new Image(); BtnNooff.src = "../images/sbc/buttons/no_out.gif";
BtnNodown = new Image(); BtnNodown.src = "../images/sbc/buttons/no_down.gif";
BtnYeson = new Image(); BtnYeson.src = "../images/sbc/buttons/yes_over.gif";
BtnYesoff = new Image(); BtnYesoff.src = "../images/sbc/buttons/yes_out.gif";
BtnYesdown = new Image(); BtnYesdown.src = "../images/sbc/buttons/yes_down.gif";
BtnOKon = new Image(); BtnOKon.src = "../images/sbc/buttons/ok_over.gif";
BtnOKoff = new Image(); BtnOKoff.src = "../images/sbc/buttons/ok_out.gif";
BtnOKdown = new Image(); BtnOKdown.src = "../images/sbc/buttons/ok_down.gif";
}
function isButton(obj)
{
return obj && (obj.name == "BtnClose" || obj.name == "BtnNo" || obj.name == "BtnYes" || obj.name == "BtnOK");
}
function focusOn() {
if(isButton(window.event.srcElement))
{
if(btnClicked == false)
{
storedfocus = window.event.srcElement.name;
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
}
else
{
storedfocus = window.event.srcElement.name;
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "down.src");
}
}
return;
}
function focusOff() {
storedfocus = "";
btnClicked = false;
turnOff();
return;
}
function turnOn() {
if (document.images && isButton(window.event.srcElement))
{
if(storedfocus == ""|| storedfocus == window.event.srcElement.name)
{
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
}
else
{
document.all[storedfocus].src = eval(storedfocus + "off.src");
//if ( document.all[ window.event.srcElement.name + "on" ] )
//{
window.event.srcElement.style.cursor = "hand";
window.event.srcElement.src = eval(window.event.srcElement.name + "on.src");
//}
}
}
return;
}
function turnOff() {
if (document.images && isButton(window.event.srcElement))
{
if (storedfocus == "")
{
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "off.src");
}
else
{
window.event.srcElement.style.cursor = "auto";
//if ( document.all[ window.event.srcElement.name + "off" ] )
//{
window.event.srcElement.src = eval(window.event.srcElement.name + "off.src");
document.all[storedfocus].src = eval(storedfocus + "on.src");
//}
}
}
return;
}
function FixMouse()
{
var i;
var x = document.images.length;
for (i = 0; i < x; i++)
{
if (document.images(i).name != "")
{
var base2 = document.images(i).name.substr(0,3);
if ( base2 == "Btn")
if (document.images(i).src == eval (document.images(i).name + "down.src"))
{
if(document.images(i).name == storedfocus)
document.images(i).src = eval (document.images(i).name + "on.src");
else
document.images(i).src = eval (document.images(i).name + "off.src");
}
//else if(document.images(i).src == eval (document.images(i).name + "on.src") && document.images(i).name == storedfocus)
//document.images(i).src = eval (document.images(i).name + "off.src");
}
}
return;
}
function turnDown() {
if (document.images && isButton(window.event.srcElement))
{
btnClicked = true;
window.event.srcElement.style.cursor = "auto";
window.event.srcElement.src = eval(window.event.srcElement.name + "down.src");
}
return;
}
function onClose(){
window.close();
return false;
}
function onYes(){
document.forms[0].action = "http://localaction.bogus.yahoo.moc/actionCancelYes?";
document.forms[0].submit();
return false;
}
function onNo(){
document.forms[0].action = "http://localaction.bogus.yahoo.moc/actionCancelNo?";
document.forms[0].submit();
return false;
}
function DocumentOnKeyPress()
{
if( event.keyCode == 32)
{
if (storedfocus == "BtnClose")
{
onClose();
window.event.returnValue = false;
}
else if (storedfocus == "BtnYes")
{
onYes();
window.event.returnValue = false;
}
else if (storedfocus == "BtnNo")
{
onNo();
window.event.returnValue = false;
}
else if (storedfocus == "BtnOK")
{
onClose();
window.event.returnValue = false;
}
}
}
function DocumentOnKeyUp()
{
if( event.keyCode == 13)
{
if (storedfocus == "BtnClose")
{
onClose();
window.event.returnValue = false;
}
else if (storedfocus == "BtnYes")
{
onYes();
window.event.returnValue = false;
}
else if (storedfocus == "BtnNo")
{
onNo();
window.event.returnValue = false;
}
else if (storedfocus == "BtnOK")
{
onClose();
window.event.returnValue = false;
}
else if( document.all("BtnClose") != null )
{
onClose();
window.event.returnValue = false;
}
else if( document.all("BtnOK") != null )
{
onClose();
window.event.returnValue = false;
}
else if( document.all("BtnYes") != null )
{
onYes();
window.event.returnValue = false;
}
}
if( event.keyCode == 27)
{
if( document.all("BtnClose") != null )
{
onClose();
window.event.returnValue = false;
}
else if( document.all("BtnNo") != null )
{
onNo();
window.event.returnValue = false;
}
else if( document.all("BtnOK") != null )
{
onClose();
window.event.returnValue = false;
}
}
}
function onStopDrag()
{
window.event.returnValue = false;
window.event.cancelBubble = true;
window.event.dataTransfer.dropEffect = "none";
window.event.dataTransfer.effectAllowed = "none";
return false;
}
function DocumentOnKeyPressX()
{
var namecheck = window.event.srcElement.name;
var base2 ="";
if( event.keyCode == 32)
{
if (namecheck)
base2 = namecheck.substr( 0, 3 );
if( window.event.srcElement.type == "text" || base2 == "Btn")
{
if (storedfocus == "BtnClose")
{
onClose();
window.event.returnValue = false;
}
else if (storedfocus == "BtnYes")
{
onYes();
window.event.returnValue = false;
}
else if (storedfocus == "BtnNo")
{
onNo();
window.event.returnValue = false;
}
else if (storedfocus == "BtnOK")
{
onClose();
window.event.returnValue = false;
}
}
else
window.event.returnValue = false;
}
}
document.onkeyup = DocumentOnKeyUp;
document.onkeypress = DocumentOnKeyPressX;
document.ondragstart = onStopDrag;
document.onmouseup = FixMouse;